package com.sinodata.bsm.common.vo;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.SequenceGenerator;
import javax.persistence.Table;

/**
 * CollectField entity. @author MyEclipse Persistence Tools
 */
@Entity
@Table(name = "COLLECT_FIELD")
public class CollectField implements java.io.Serializable, Cloneable {

    /**
     * serialVersionUID
     */
    private static final long serialVersionUID = -5532069491590578965L;

    // Fields
    private Long id;
    private Long collectTaskId;
    private Long prop;
    private String fieldName;

    // Constructors

    /** default constructor */
    public CollectField() {
    }

    /** minimal constructor */
    public CollectField(Long id) {
        this.id = id;
    }

    /** full constructor */
    public CollectField(Long id, Long collectTaskId, Long prop, String fieldName) {
        this.id = id;
        this.collectTaskId = collectTaskId;
        this.prop = prop;
        this.fieldName = fieldName;
    }

    // Property accessors
    @Id
    @GeneratedValue(strategy = GenerationType.SEQUENCE, generator = "sequence")
    @SequenceGenerator(name = "sequence", sequenceName = "COLLECT_FIELD_SEQ")
    @Column(name = "ID", unique = true, nullable = false, precision = 18, scale = 0)
    public Long getId() {
        return this.id;
    }

    public void setId(Long id) {
        this.id = id;
    }

    @Column(name = "COLLECT_TASK_ID", precision = 18, scale = 0)
    public Long getCollectTaskId() {
        return this.collectTaskId;
    }

    public void setCollectTaskId(Long collectTaskId) {
        this.collectTaskId = collectTaskId;
    }

    @Column(name = "PROP", precision = 18, scale = 0)
    public Long getProp() {
        return this.prop;
    }

    public void setProp(Long prop) {
        this.prop = prop;
    }

    @Column(name = "FIELD_NAME", length = 512)
    public String getFieldName() {
        return this.fieldName;
    }

    public void setFieldName(String fieldName) {
        this.fieldName = fieldName;
    }

    @Override
    public CollectField clone() throws CloneNotSupportedException {
        CollectField testClone = null;
        try {
            testClone = (CollectField) super.clone();
            testClone.setId(null);
        } catch (CloneNotSupportedException e) {
            e.printStackTrace();
        }
        return testClone;

    }

    @Override
    public String toString() {
        return "CollectField [id=" + id + ", collectTaskId=" + collectTaskId + ", prop=" + prop + ", fieldName=" + fieldName + "]";
    }

}